package com.zf.yichat.mapper;

import com.zf.yichat.base.FsMapper;
import com.zf.yichat.dto.UltragroupMemberUserDto;
import com.zf.yichat.model.User;
import com.zf.yichat.model.UserJoinUltragroup;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserJoinUltragroupMapper extends FsMapper<UserJoinUltragroup> {

    /**
     * 查询用户是否在该超级群中
     * @param userId
     * @param ultragroupId
     * @return
     */
    UserJoinUltragroup queryUserInUltragroup(@Param("userId") Long userId,@Param("ultragroupId") String ultragroupId);

    /**
     * 查询超级群中的用户列表
     * @param ultragroupId
     * @param userId
     * @param nick
     * @param mobile
     * @param realName
     * @return
     */
    List<UltragroupMemberUserDto> queryUltragroupMember(@Param("ultragroupId") String ultragroupId,@Param("userId") String userId,
                                                      @Param("nick") String nick,@Param("mobile") String mobile,
                                                      @Param("realName") String realName);

    /**
     * 删除超级群用户
     * @param ultragroupId
     * @param userId
     * @return
     */
    int deleteUltragroupMember(@Param("ultragroupId") String ultragroupId,@Param("userId") String userId);

    /**
     * 模糊查询超级群的成员
     * @param ultragroupId
     * @param appid
     * @param nick
     * @return
     */
    List<User> queryUserByParam(@Param("ultragroupId") String ultragroupId, @Param("appId") String appid,@Param("nick") String nick);
}